﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace lan_file_transfer
{
    internal struct DataPiece
    {
        static ulong index;
        byte[] data;
        internal ulong Index
        {
            get
            {
                return index;
            }
        }
        internal byte[] Data
        {
            set
            {
                index = (index != ulong.MaxValue) ? index++ : 0;
                data = value;
            }
            get
            {
                return data;
            }
        }
        //internal byte[] getByteArray()
        //{
        //    byte[] res = new byte[8 + data.Length];
        //    Array.Copy(BitConverter.GetBytes(index), res, 8);
        //    Array.Copy(data, 8, res, 0, data.Length);

        //    return res;
        //}
    }
}
